<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新品有戏后台管理</title>
    <link href="__CSS__/boot.css" rel="stylesheet">
    <link href="__STATIC__/layui/css/layui.css" rel="stylesheet">
    <script src="__JS__/jquery.js"></script>
    <script src="__JS__/layer/layer.js"></script>
    <script src="__STATIC__/layui/layui.js"></script>
    <style>
        th{
            text-align: center;
            vertical-align: middle!important;
        }
    </style>
</head>
<body>
{include file="base/header" /}
<br/>
<table class="layui-table">
    <colgroup>
        <col width="150">
        <col width="200">
        <col>
    </colgroup>
    <thead>
    <tr>
        <th>编号</th>
        <th>商品名称</th>
        <th>商家联系人</th>
        <th>进价</th>
        <th>售价</th>
        <th>购买数量</th>
        <th>合计</th>
        <th>实际合计</th>
        <th>订单号</th>
        <th>下单日期</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $result as $val}
        <tr>
            <td>{$val.id}</td>
            <td>{$val.pname}</td>
            <td>{$val.linkman}</td>
            <td>{$val.purchaseprice}</td>
            <td>{$val.retailprice}</td>
            <td>{$val.number}</td>
            <td>{$val.total}</td>
            <td>{$val.actualtotal}</td>
            <td>{$val.ordernumber}</td>
            <td>{$val.date}</td>
            <td>
                {if $val.status == 1} 购买申请 {elseif $val.status == 2 /} 以通过 {elseif $val.status == 3 /} 邮寄中 {elseif $val.status ==4 /}货已到 {else/}以完成{/if}
            </td>
            <td>
                <button onclick="detail({$sid},{$val.id})" type="button" class="btn btn-primary btn-xs" >订单详情</button>
                <button onclick="damage({$val.id})" type="button" class="btn btn-warning btn-xs" >损坏</button>
            </td>
        </tr>
    {/foreach}
    </tbody>
</table>
</body>
<script>
    //损坏
    function damage(id) {
        window.location.href = "{:url('index/shop/postdamage')}?id="+id;
    }
    //订单详情
    function detail(sid,id) {
        window.location.href = "{:url('index/shop/postorder')}?sid="+sid+"&id="+id;
    }
</script>
</html>